package com.boot.controller;

import com.boot.domain.CommonResult;
import com.boot.mapper.AccountMapper;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * Description:
 *
 * @Autor: Rolin
 * datetime: 05-09-21:28
 */
@RestController
public class AccountController {

    @Resource
    private AccountMapper accountMapper ;


    @PostMapping("/account/decrease")
    CommonResult decrease(@RequestParam("userId") Long userId,
                          @RequestParam("money") BigDecimal money){
        accountMapper.decrease(userId,money);
        return new CommonResult(200,"扣减账户余额成功！");
    }
}
